function getChildren(partent) {
    var children = partent.children;
    for (var i = 0; i < children.length; i++) {
        console.log(children[i].nodeName);
        arguments.callee(children[i]);
    }
}

window.onload = function () {
    getChildren(document.body)
};